package com.ybkj.chat.module.main.fragment;

import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.ybkj.chat.R;
import com.ybkj.chat.base.BaseMvpFragment;
import com.ybkj.chat.bean.response.AllFriendRes;
import com.ybkj.chat.ui.adapter.AllFriendAbroadAdapter;
import com.ybkj.chat.ui.view.recyclerview.XRecyclerView;
import com.ybkj.chat.ui.view.refreshlayout.XRefreshLayout;

import butterknife.BindView;

/**
 * 全部圈友
 */
public class AllFriendFragment extends BaseMvpFragment {
    @BindView(R.id.all_friend_recycle)
    XRecyclerView allFriendRecycle;
    @BindView(R.id.refresh_layout)
    XRefreshLayout refreshLayout;


    private AllFriendAbroadAdapter aboradAdapter;

    @Override
    protected void injectPresenter() {

    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initData() {
        aboradAdapter = new AllFriendAbroadAdapter(mContext);
        aboradAdapter.addData(new AllFriendRes(false, "ff"));
        aboradAdapter.addData(new AllFriendRes(false, "ff"));
        aboradAdapter.addData(new AllFriendRes(false, "ff"));
        aboradAdapter.addData(new AllFriendRes(false, "ff"));
        aboradAdapter.addData(new AllFriendRes(false, "ff"));
        aboradAdapter.bindToRecyclerView(allFriendRecycle);
        aboradAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
            @Override
            public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
                if (aboradAdapter.getItem(position).isShow()) {
                    aboradAdapter.getItem(position).setShow(false);
                } else {
                    aboradAdapter.getItem(position).setShow(true);
                }
                aboradAdapter.notifyDataSetChanged();
            }
        });
    }

    @Override
    public int getLayoutId() {
        return R.layout.fragment_all_friend;
    }

    @Override
    protected String getSimpleNme() {
        return null;
    }


}
